home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- # This is the postinst script for the Debian GNU/Linux apmd package
- #
- # Written by Dirk Eddelbuettel <edd@debian.org>
- # Debconf changes added by Chris Hanson <cph@debian.org>
-
- set -e
- umask 022
-
- case "${1}" in
- (configure)
- . /usr/share/debconf/confmodule || exit 0
-
- # Rejection of APM events doesn't yet work; see apmd_proxy.
- # CONFFILE=/etc/apm/apmd_proxy.conf
- # TEMPLATE=/usr/share/apmd/apmd_proxy.conf
- # SEDFILE="${CONFFILE}.sed.$$"
- # TMPFILE="${CONFFILE}.tmp.$$"
- #
- # trap "rm -f ${SEDFILE} ${TMPFILE}" EXIT INT QUIT TERM
- #
- # db_get apmd/overwrite-config-file || true
- # if [ "${RET}" = "true" ]; then
- #
- # # Convert the debconf bindings to a sed script that will
- # # insert the bindings into the configuration file.
- # rm -f "${SEDFILE}" || true
- # xfer_binding ()
- # {
- # db_get "${2}" || true
- # echo "s%^${1}=\(.*\)\$%${1}=${RET}%;" >> "${SEDFILE}"
- # }
- # xfer_binding SUSPEND_ON_AC apmd/suspend-on-ac
- #
- # # Apply the sed script to the template file to create the
- # # configuration file.
- # cat "${TEMPLATE}" | sed -f "${SEDFILE}" > "${TMPFILE}"
- # rm -f "${SEDFILE}" || true
- # mv -f "${TMPFILE}" "${CONFFILE}"
- #
- # fi
- db_stop
- if [ -z "$(ls /etc/apm/suspend.d/*hwclock 2> /dev/null)" ]; then
- mkdir -p /etc/apm/suspend.d
- ln -sf ../scripts.d/hwclock /etc/apm/suspend.d/99hwclock
- fi
- if [ -z "$(ls /etc/apm/resume.d/*hwclock 2> /dev/null)" ]; then
- mkdir -p /etc/apm/resume.d
- ln -sf ../scripts.d/hwclock /etc/apm/resume.d/00hwclock
- fi
-
- # Remove shutdown and reboot links; this init script does not need them.
- if dpkg --compare-versions "$2" lt "3.2.2-7ubuntu1"; then
- rm -f /etc/rc0.d/K20apmd /etc/rc6.d/K20apmd
- fi
- ;;
- (abort-upgrade|abort-remove|abort-deconfigure)
- ;;
- (*)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
- esac
-
- # Automatically added by dh_installinit
- if [ -x "/etc/init.d/apmd" ]; then
- update-rc.d apmd multiuser >/dev/null
- if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d apmd start || exit $?
- else
- /etc/init.d/apmd start || exit $?
- fi
- fi
- # End automatically added section
-
-
- exit 0
-